<div class="sidebar">
<% if ["show","new","edit","node"].index(params[:action]) %>
  <div class="box">
    <h2><a href="<%= node_topics_path(@node.id) %>"><%= @node.name %></a></h2>
    <% if ["new"].index params[:action] %>
    <p class="sumamry">
      <%= @node.summary %>
    </p>
    <% end %>
    <div class="content">
      <a class="btn success" href="<%= new_topic_path(:node => @node.id) %>">发布新帖</a>
    </div>
  </div>
<% elsif params[:action] == "index" %>
  <div class="box">
    <h2>社区论坛</h2>
    <p>
      发贴请先进入一个节点以后点击“发布新帖”。
    </p>
		<p style="text-align:center;">
			<a href="<%= homeland.feed_topics_url %>" title="用RSS阅读器订阅<%= Setting.app_name %>论坛新贴">
				<%= image_tag('feed.png', :alt => "订阅#{Setting.app_name}论坛新贴") %></a>
		</p>
  </div>
<% end %>
<%= cache("topic/init_list_sidebar/hot_nodes",:expires_in => 30.minutes) do %>
  <% if not @hot_nodes.blank? %>
  <div class="hot_nodes nodes box">
    <h2>热门节点</h2>
    <p>
      <% @hot_nodes.each do |node| %>
        <a href="<%= node_topics_path(:id => node.id) %>"><%= node.name %></a>
      <% end %>
    </p>
  </div>
  <% end %>
<% end %>
<% if current_user and (not @user_last_nodes.blank?) %>
<div class="user_last_nodes nodes box">
  <h2>最近访问节点</h2>
  <p>
    <% @user_last_nodes.each do |node| %>
      <a href="<%= node_topics_path(:id => node.id) %>"><%= node.name %></a>
    <% end %>
  </p>
</div>
<% end %>
<% if ["new"].index(params[:action]) %>
  <div id="topic_new_tip" class="box">
    <h2>发贴说明</h2>
    <ol>
      <li>发布后正文排版会自动安你在文本框里面输入的样子排列.如果里面带有 URL地址，将会自动转变为超级链接。</li>
    </ol>
  </div>
<% end %>
<% if params[:action] == "index" %>
<div class="totals box">
	<h2>统计信息</h2>
	<ul>
		<li>贴子数: <%= Homeland::Topic.count %> 篇</li>
		<li>回贴数: <%= Homeland::Reply.count %> 条</li>
	</ul>
</div>
<% end %>
</div>
